package com.xwamp.sqls;

public class AdminSqls implements ModelSqlInterface {
	public static final AdminSqls me = new AdminSqls();
	private final String table = "t_user_admin";

	public String getTableName() {
		return table;
	}

	public String getPagingSelectSql() {
		return "select *";
	}

	public String getPagingExceptSelectSql() {
		return "from " + table;
	}

	public String getFindByIdSql() {
		return "select * from " + table + " where user_id = ?";
	}

	public String getUpdatePasswordSql() {
		return "update " + table + " set password=? where user_id=?";
	}

	public String getUpdateRoleIdSql() {
		return "update " + table + " set role_id=? where user_id=?";
	}

	public String getUpdateStatusSql() {
		return "update " + table + " set status=? where user_id=?";
	}

	public String getFindPasswordSql() {
		return "select top 1 operate_password from " + table + " where user_id=?";
	}

	public String getUpdateRoleTitleSql() {
		return "update u set u.role_title=r.title from " + table
				+ " u left join t_auth_group r on u.role_id=r.id where u.role_title='' and u.role_id>0";
	}
}
